const TOKEN_KEY = 'geek-app-87'
// 获取token    写一行不需要return 结果分开要加return 才能拿到结果
const getToken = () => localStorage.getItem(TOKEN_KEY)

// 设置token
const setToken = data => localStorage.setItem(TOKEN_KEY, JSON.stringify(data))

// 移除token
const removeToken = () => localStorage.removeItem(TOKEN_KEY)

// 判断是否登录
const isAuth = () => !!getToken()

export { getToken, setToken, removeToken, isAuth }
